<div class="layui-fluid" id="VIEW-list-table" lay-title="商品列表" lig-title="co-goods-title">
    <div class="layui-card">
        <div class="layui-card-header" lig-lang="label-searchTitle">筛选数据</div>
        <div class="layui-card-body">
            <form class="layui-form" lay-filter="lig-goods-searchform">
                <form class="layui-form" lay-filter="lig-goods-searchform">
                    <div class="layui-form-item" style="margin-bottom:5px;">
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="pd-customer">客户</label>
                            <div class="layui-input-inline">
                                <select name="customerCode">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="goods-txm">珠宝编号</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="txm" />
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="goods-spbh">商品编号</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="spbh" />
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="goods-splb">首饰品种</label>
                            <div class="layui-input-inline">
                                <select name="splb">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="goods-spmc">商品名称</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="spmc" />
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="goods-spwz">商品位置</label>
                            <div class="layui-input-inline">
                                <select name="spwz">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="goods-csqzsj">出售时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="gmsjQs" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid">--</div>
                            <div class="layui-input-inline">
                                <input type="text" name="gmsjJs" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <input type="button" class="layui-btn layui-btn-sm" lay-filter="lig-goods-search" lig-lang="btn-search" value="查询">
                            <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary" lig-lang="btn-reset">重置</button>
                        </div>
                    </div>
                </form>
            </form>
        </div>
    </div>
    <div class="layui-card">
        <div class="layui-card-body nepadmin-table-full">
            <table lay-filter="lig-goods-table"></table>
        </div>
    </div>
</div>
<script type="text/html" id="tpl-row-toolBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="lig-get" lig-lang="btn-get">查看</a>
</script>
<script type="text/html" id="tpl-goods-get">
    <form class="layui-form" lay-filter="lig-saveForm" style="padding-right:10px;">
        <input type="hidden" name="goodsId" value="{{d.goodsId}}">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top:10px;margin-bottom:10px;">
            <legend style="color:#5a8bff;font-size:16px;font-weight:500;" lig-lang="goods-baseInfo">基本信息</legend>
        </fieldset>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-txm">珠宝编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="txm" autocomplete="off" class="layui-input" lay-verify="required"
                               value="{{ d.txm || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-txm">条形码</label>
                    <div class="layui-input-block">
                        <input type="text" name="barcode" autocomplete="off" class="layui-input" lay-verify="required"
                               value="{{ d.barcode || '' }}">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-spbh">商品名称</label>
                    <div class="layui-input-block">
                        <input type="text" autocomplete="off" class="layui-input" value="{{d.sku}}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-rksj">入库日期</label>
                    <div class="layui-input-block">
                        <input type="text" name="rksj" autocomplete="off" class="layui-input"
                               value="{{ d.rksj || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-sgrq">上柜日期</label>
                    <div class="layui-input-block">
                        <input type="text" name="sgrq" autocomplete="off" class="layui-input"
                               value="{{ d.sgrq || '' }}">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-spwz">商品位置</label>
                    <div class="layui-input-block">
                        <input type="text" autocomplete="off" class="layui-input" value="{{d.spwzmc}}" disabled>
                    </div>
                </div>
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top:0;margin-bottom:10px;">
            <legend style="color:#5a8bff;font-size:16px;" lig-lang="goods-caiGou">生产信息</legend>
        </fieldset>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-scs">生产商</label>
                    <div class="layui-input-block">
                        <input type="text" name="scs" autocomplete="off" class="layui-input"
                               value="{{ d.scs || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-sjs">设计者</label>
                    <div class="layui-input-block">
                        <input type="text" name="sjs" autocomplete="off" class="layui-input"
                               value="{{ d.sjs || '' }}">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-scrq">生产日期</label>
                    <div class="layui-input-block">
                        <input type="text" name="scrq" autocomplete="off" class="layui-input"
                               value="{{ d.scrq || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-ccrq">出厂日期</label>
                    <div class="layui-input-block">
                        <input type="text" name="ccrq" autocomplete="off" class="layui-input"
                               value="{{ d.ccrq || '' }}">
                    </div>
                </div>
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top:0;margin-bottom:10px;">
            <legend style="color:#5a8bff;font-size:16px;" lig-lang="goods-caiGou">鉴定信息</legend>
        </fieldset>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-jdjg">鉴定机构</label>
                    <div class="layui-input-block">
                        <input type="text" name="jdjg" autocomplete="off" class="layui-input"
                               value="{{ d.jdjg || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-zsh">证书号</label>
                    <div class="layui-input-block">
                        <input type="text" name="zsh" autocomplete="off" class="layui-input"
                               value="{{ d.zsh || '' }}">
                    </div>
                </div>
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top:0;margin-bottom:10px;">
            <legend style="color:#5a8bff;font-size:16px;" lig-lang="goods-caiGou">代理信息</legend>
        </fieldset>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-dls">代理商</label>
                    <div class="layui-input-block">
                        <input type="text" name="dls" autocomplete="off" class="layui-input"
                               value="{{ d.dls || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-xss">销售商</label>
                    <div class="layui-input-block">
                        <input type="text" name="xss" autocomplete="off" class="layui-input"
                               value="{{ d.xss || '' }}">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-dpmc">销售网点</label>
                    <div class="layui-input-block">
                        <input type="text" name="dpmc" autocomplete="off" class="layui-input"
                               value="{{ d.dpmc || '' }}">
                    </div>
                </div>
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top:0;margin-bottom:10px;">
            <legend style="color:#5a8bff;font-size:16px;" lig-lang="goods-caiGou">销售信息</legend>
        </fieldset>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-gmsj">销售时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="gmsj" autocomplete="off" class="layui-input"
                               value="{{ d.gmsj || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-xsje">销售金额</label>
                    <div class="layui-input-block">
                        <input type="text" name="xsje" autocomplete="off" class="layui-input"
                               value="{{ d.xsje || '' }}">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-gmr">购买人</label>
                    <div class="layui-input-block">
                        <input type="text" name="gmr" autocomplete="off" class="layui-input"
                               value="{{ d.gmr || '' }}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-gmrTel">联系电话</label>
                    <div class="layui-input-block">
                        <input type="text" name="gmrTel" autocomplete="off" class="layui-input"
                               value="{{ d.gmrTel || '' }}">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-skfs">收款方式</label>
                    <div class="layui-input-block">
                        <input type="text" autocomplete="off" class="layui-input" value="{{d.skfsName}}" disabled>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label" lig-lang="goods-xpjss">票据</label>
                    <div class="layui-input-block">
                        <input type="text" name="pj" autocomplete="off" class="layui-input"
                               value="{{ d.pj || '' }}">
                    </div>
                </div>
            </div>
        </div>
    </form>
</script>
<script>
    layui.use(['admin', 'table', 'form', 'dropdown', 'laytpl', 'laydate', 'jquery','lig'], function (admin, table, form, dropdown, laytpl, laydate, $, lig) {

        var _searchForm = '[lay-filter="lig-goods-searchform"]';
        lig.selectCustomerList(_searchForm + '  select[name="customerCode"]');

        // 加载字典项实例
        lig.loadSelectDict('sku_splb', _searchForm + ' select[name="splb"]');
        lig.loadSelectDict('goods_spwz', _searchForm + ' select[name="spwz"]');
        laydate.render({
            elem: _searchForm + ' input[name="gmsjQs"]'
        });
        laydate.render({
            elem: _searchForm + ' input[name="gmsjJs"]'
        });
        form.render();


        lig.table({
            elem: '[lay-filter="lig-goods-table"]',
            url: 'pd/co/goods/page',
            cols: [[
                {title: '<span lig-lang="label-opt">操作</span>', toolbar: '#tpl-row-toolBar', align: 'left', width: 70},
                { title: '<span lig-lang="goods-txm">珠宝编号</span>', field: 'txm', minWidth: 140 },
                { title: '<span lig-lang="goods-tid">Rfid标识号</span>', field: 'tid', minWidth: 120 },
                { title: '<span lig-lang="goods-spbh">商品编号</span>', field: 'spbh', minWidth: 200 },
                { title: '<span lig-lang="goods-rksj">入库时间</span>', field: 'rksj', minWidth: 120 },
                { title: '<span lig-lang="goods-rksl">入库数量</span>', field: 'rksl', minWidth: 120 },
                { title: '<span lig-lang="goods-scs">生产商</span>', field: 'scs', minWidth: 120 },
                { title: '<span lig-lang="goods-scrq">生产日期</span>', field: 'scrq', minWidth: 120 },
                { title: '<span lig-lang="goods-ccrq">出厂日期</span>', field: 'ccrq', minWidth: 120 },
                { title: '<span lig-lang="goods-sjs">设计者</span>', field: 'sjs', minWidth: 120 },
                { title: '<span lig-lang="goods-jdjg">鉴定机构</span>', field: 'zsh', minWidth: 120 },
                { title: '<span lig-lang="goods-zsh">证书号</span>', field: 'zsh', minWidth: 120 },
                { title: '<span lig-lang="goods-dls">代理商</span>', field: 'dls', minWidth: 120 },
                { title: '<span lig-lang="goods-xss">销售商</span>', field: 'xss', minWidth: 120 },
                { title: '<span lig-lang="goods-dpmc">销售网点</span>', field: 'dpmc', minWidth: 120 },
                { title: '<span lig-lang="goods-xsje">销售金额</span>', field: 'xsje', minWidth: 120 },
                { title: '<span lig-lang="goods-gmsj">销售时间</span>', field: 'gmsj', minWidth: 120 },
                { title: '<span lig-lang="goods-gmr">购买人</span>', field: 'gmr', minWidth: 120 },
                { title: '<span lig-lang="goods-gmrTel">联系电话</span>', field: 'gmrTel', minWidth: 120 },
                { title: '<span lig-lang="goods-skfs">收款方式</span>', field: 'skfsName', minWidth: 120 },
                { title: '<span lig-lang="goods-pj">票据</span>', field: 'pj', minWidth: 120 },
                { title: '<span lig-lang="goods-spwzmc">商品位置</span>', field: 'spwzmc', minWidth: 120 }

            ]]
        },{
            mode: 'dialog',
            entity: 'goods',
            primaryField: 'goodsId',

            getContent: $('#tpl-goods-get').html(),
            getTitle: '<span lig-lang="goods-detail">商品详情</span>',
            getWidth: '65%',
            getHeight:'90%',
            onGet: function() {return true;},
            onGetOpened: function() {
            },
            getUrl: 'pd/co/goods/{goodsId}'
        });

    })
</script>